package cn.com.liuwenquan.flex.business.Delegates
{
	import com.adobe.cairngorm.business.ServiceLocator;
	import cn.com.liuwenquan.flex.vo.User;
	import mx.rpc.IResponder;
	
	/**
	 * 委托类
	 * 调用service,并将结果提交给command，这一步可选
	 **/
	public class LoginDelegate
	{
		private var responder:IResponder;
		private var service:Object;
		
		//构造函数
		public function LoginDelegate(responder :IResponder){
		  this.service = ServiceLocator.getInstance().getRemoteObject("loginRo");
		  this.responder = responder;
		}
		
		//外部调用方法
		public function  authenticate(user:User):void{
			var call:Object = service.authenticate(user);
			call.addResponder(responder);
		}
	}
}